/*
 * @Author: ygnnli 1585923072@qq.com
 * @Date: 2024-08-25 15:50:21
 * @LastEditors: ygnnli 1585923072@qq.com
 * @LastEditTime: 2024-08-25 16:13:10
 * @FilePath: /boost_searcher/test/http_test.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "../cpp-httplib/httplib.h"

const std::string root_path = ".././wwwroot";

int main()
{
    httplib::Server svr;

    // svr.Get("/hi",[](const httplib::Request& req, httplib::Response& rsp){rsp.set_content("hello word!","text/plain ; charset=utf-8");});

    svr.set_base_dir(root_path.c_str());//设置静态资源目录

    svr.Get("/hi", [](const httplib::Request &req, httplib::Response &rsp)
            { rsp.set_content("你的名字是李芙烘吗 !", "text/plain ; charset=utf-8"); });

    svr.listen("0.0.0.0", 8081);

    return 0;
}